package com.offcn.seckill.listener;

import com.alibaba.fastjson.JSON;
import org.springframework.amqp.rabbit.annotation.RabbitHandler;
import org.springframework.amqp.rabbit.annotation.RabbitListener;
import org.springframework.stereotype.Component;

import java.util.Map;

@Component
@RabbitListener(queues = "queue.seckillorder")
public class SeckillOrderPayListener {

    @RabbitHandler
    public void consumerMessage(String message){
        Map<String,String> map = JSON.parseObject(message, Map.class);
        System.out.println("监听到的数据:" + map);
    }
}
